import Vue from 'vue'
import Vuex from 'vuex'

import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        id: '',
        userType: '',
        seekerFilterSelect: '',
        // contactId: '',
        messageContact: '',
        seekerSearchOccupationId: '',
        seekerSearchData: {
            seekerInput: '',
            city: '0',
            province: '0',
            salary: '0',
            degree: '0',
            experience: '0',
            category: '0',
            nature: '0',
            scale: '0'
        }
    },
    getters: {
    },
    mutations: {
        setId(state, payload) {
            state.id = payload
        },
        setUserType(state, payload) {
            state.userType = payload
        },
        setSeekerFilterSelect(state, payload) {
            state.seekerFilterSelect = payload;
        },
        setMessageContact(state, payload) {
            state.messageContact = payload;
        },
        setSeekerSearchOccupationId(state, payload) {
            state.seekerSearchOccupationId = payload
        },
        setSeekerSearchData(state, payload) {
            state.seekerSearchData.seekerInput = payload
        },
        setSeekerSelectCity(state, payload) {
            state.seekerSearchData.city = payload
        },
        setSeekerSelectProvince(state, payload) {
            state.seekerSearchData.province = payload
        },
        setSeekerSelectSalary(state, payload) {
            state.seekerSearchData.salary = payload
        },
        setSeekerSelectDegree(state, payload) {
            state.seekerSearchData.degree = payload
        },
        setSeekerSelectExperience(state, payload) {
            state.seekerSearchData.experience = payload
        },
        setSeekerSelectCategory(state, payload) {
            state.seekerSearchData.category = payload
        },
        setSeekerSelectNature(state, payload) {
            state.seekerSearchData.nature = payload
        },
        setSeekerSelectScale(state, payload) {
            state.seekerSearchData.scale = payload
        }
    },
    actions: {
    },
    modules: {
    },
    plugins: [createPersistedState()]
})
